package com.njtoyo.taxi.admin.mapper.master.entity.local_service;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.njtoyo.taxi.admin.mapper.master.enums.local_service.LifeMerchantCommodityState;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 商品表
 * </p>
 *
 * @author Dell
 * @since 2022-03-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LifeMerchantCommodity对象", description = "商品表")
public class LifeMerchantCommodity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "商品类型ID")
    private Long commodityCategoryId;

    @ApiModelProperty(value = "商家ID")
    private Long merchantId;

    @ApiModelProperty(value = "商品名称")
    private String name;

    @ApiModelProperty(value = "商品标题")
    private String title;

    @ApiModelProperty(value = "商品价格")
    private Integer unitPrice;

    @ApiModelProperty(value = "商品积分")
    private Integer unitPoint;

    @ApiModelProperty(value = "商品图片URL")
    private String iconImageUrl;

    @ApiModelProperty(value = "商品详情")
    private String details;

    @ApiModelProperty(value = "原价")
    private Integer originalCost;

    @ApiModelProperty(value = "商品分成价")
    private Integer shareProfitPrice;

    @ApiModelProperty(value = "分润比例")
    private BigDecimal proportion;

    @ApiModelProperty(value = "商品状态 0:waiting_for_review[待审核],1:review_failed[审核未通过],2:review_approved[审核已通过(未上架)],3:on_shelf[已上架],4:freeze_up[冻结]")
    private LifeMerchantCommodityState state;

    @ApiModelProperty(value = "库存")
    private Integer store;

    @ApiModelProperty(value = "排序号;越大越前")
    private Integer sortBy;

    @ApiModelProperty(value = "销量")
    private Integer salesCount;

    @ApiModelProperty(value = "需要去自提点提货 0:false,1:true")
    private Boolean toPickUpLocation;

    @ApiModelProperty(value = "核销数量")
    private Integer verificationCount;

    @ApiModelProperty(value = "特殊商品规则，例如优惠券：[{'templateId': 1, 'quantity': 1}]")
    private String template;

    @ApiModelProperty(value = "兑换后截止日期天数")
    private Integer deadlineDay;

    @ApiModelProperty(value = "开始时间")
    private Date startedAt;

    @ApiModelProperty(value = "结束时间")
    private Date endedAt;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createdAt;

    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updatedAt;

    @ApiModelProperty(value = "是否为赠送商品")
    private Boolean isPresented;


}
